package com.tech.pattern.factory.simplefactory.operation;

/**
 * @Title OperationFactory.java
 * @Description TODO 工厂类
 * @author willard
 * @date 2018年7月15日 上午7:53:19
 * @version V1.0
 */
public class OperationFactory {

    public Operation operation(String str) {
        switch (str) {
        case "+":
            return new AddOperation();
        case "-":
            return new SubOperation();
        //case "*"
        default:
            break;
        }
        return null;
    }

}
